var drageve = function(dom){
		this.dom = dom;
		this.dom.style.cursor = "move";
		var that = this;
		if(getStyle(this.dom,"position")!=="absolute"){
			this.left = parseInt(this.dom.getBoundingClientRect().left);
	  		this.top = parseInt(this.dom.getBoundingClientRect().top);
	  		this.dom.style.left = this.left+"px";
			this.dom.style.top = this.top+"px";
			this.dom.style.position = "fixed";
		}else{
			this.dom.style.position = "absolute";
			this.left = parseInt(getStyle(this.dom,"left"));
	  		this.top = parseInt(getStyle(this.dom,"top"));
		};
		this.dom.onmousedown = function(ev){
			var ev = ev || window.event;
			that.preMousex = mousePosition(ev).x;
			that.preMousey = mousePosition(ev).y;
			document.onmousemove = function(ev){
				var ev = ev || window.event;
				that.nowMousex = mousePosition(ev).x;
				that.nowMousey = mousePosition(ev).y;
				that.top = (that.nowMousey-that.preMousey)+ that.top;
				that.left = (that.nowMousex-that.preMousex)+ that.left;
				that.dom.style.top = that.top+"px";
				that.dom.style.left = that.left+"px";
				that.preMousex = that.nowMousex;
				that.preMousey = that.nowMousey;
			};
			document.onmouseup = function(){
				document.onmousemove = null;
				document.onmouseup = null;
			};
			return false;
		};
		function getStyle(el,attr){
			return el.currentStyle?el.currentStyle[attr]:getComputedStyle(el,null)[attr];
		};
		function mousePosition(ev){ 
			if(ev.pageX || ev.pageY){ 
				return {x:ev.pageX, y:ev.pageY}; 
			};
			return { 
				x:ev.clientX + document.body.scrollLeft - document.body.clientLeft,
			 	y:ev.clientY + document.body.scrollTop - document.body.clientTop
			}; 
		};
	};